/*
 * Copyright 1999-2011 Alibaba Group.
 *  
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  
 *      http://www.apache.org/licenses/LICENSE-2.0
 *  
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.yuchen.core.common;


/**
 * Version
 * 
 * @author william.liangf
 */
public final class Version {


    /**
     * 标示类,没有new的可能性
     */
    Version() {}

    /**
     * 版本号的命名规范
     *
     * <pre>
     * [大版本号].[质量号].[发布流水号]
     * </pre>
     *
     * 这里有点说明
     * <ul>
     * <li>大版本号 - 表示 API 的版本，如果没有重大变化，基本上同样的大版本号，使用方式是一致的
     * <li>质量号 - 可能为 a: Alpha内部测试品质, b:Beta 公测品质, r:Release 最终发布版
     * <li>发布流水 - 每次发布增加 1
     * </ul>
     *
     */
    public static String getVersion() {
        return String.format("%d.%s.%d",
                majorVersion(),
                releaseLevel(),
                minorVersion());
    }

    /**
     * 大版本号
     */
    public static int majorVersion() {
        return 1;
    }

    /**
     * 发布流水
     */
    public static int minorVersion() {
        return 1;
    }

    /**
     * 质量号
     */
    public static String releaseLevel() {
        return "r";
    }

}